<template>
  <div>
    <el-card class="box-card">
      <div>
        <div>
          <el-select v-model="value" placeholder="课程大类" clearable style="width: 200px" size="mini">
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
          <el-select v-model="value" placeholder="任务状态" clearable style="width: 200px" size="mini">
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
          <el-input placeholder="课程名称、指导老师" v-model="input" size="mini" clearable style="width: 250px" />
          <el-button size="mini" type="primary" icon="el-icon-search">搜索</el-button>
        </div>
      </div>
    </el-card>
    <el-card class="box-card" style="margin-top: 20px">
      <el-table :data="tableData" border="" style="width: 100%" @selection-change="handleSelectionChange" v-loading="loading">
        <el-table-column type="index" label="序号" width="50" align="center" />
        <el-table-column label="操作" align="center" width="60">
          <template slot-scope="">
            <el-button size="mini" type="text" @click="editor">详情</el-button>
          </template>
        </el-table-column>
        <el-table-column prop="date" label="课程大类" align="center" />
        <el-table-column prop="address" label="训练课程名称" width="120" align="center" />
        <el-table-column prop="address" label="任务名称" align="center" />
        <el-table-column prop="address" label="指导老师" align="center" />
        <el-table-column prop="address" label="开始时间" align="center" />
        <el-table-column prop="address" label="截止时间" align="center" />
        <el-table-column prop="address" label="练习次数" align="center" />
        <el-table-column prop="address" label="班级" align="center" />
        <el-table-column prop="address" label="任务状态" align="center" />
        <el-table-column prop="address" label="总人数" align="center" />
        <el-table-column prop="address" label="已完成" align="center" />
        <el-table-column prop="address" label="未完成" align="center" />
      </el-table>
      <el-pagination
        :current-page="value"
        :page-sizes="[5, 10, 15, 20]"
        :page-size="100"
        layout="total, sizes, prev, pager, next, jumper"
        :total="10"
        background
        style="margin-top: 20px"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
      >
      </el-pagination>
    </el-card>
    <!-- <el-dialog title="新增" :visible.sync="dialogVisible" width="65%">
      <Add @handCancle="handCancle"></Add>
    </el-dialog> -->
    <!-- <el-dialog title="发布任务" :visible.sync="dialogVisible1" width="50%">
      <Release @handCancle="handCancle"></Release>
    </el-dialog> -->
    <el-dialog title="任务详情" :visible.sync="dialogVisible2" width="65%">
      <Editor @handCancle="handCancle"></Editor>
    </el-dialog>
  </div>
</template>

<script>
// import Release from './release.vue'
import Editor from './editor.vue'
export default {
  components: {
    // Release,
    Editor
  },
  data() {
    return {
      input: '',
      options: '',
      tableData: [],
      switch1: true,
      dialogVisible1: false,
      dialogVisible2: false,
      value: null,
      loading: false
    }
  },
  methods: {
    editor() {
      this.dialogVisible2 = true
    },
    release() {
      this.dialogVisible1 = true
    },
    handCancle() {
      this.dialogVisible1 = false
      this.dialogVisible2 = false
    },
    handleSelectionChange(val) {
      this.multipleSelection = val
    },
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`)
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`)
    }
  }
}
</script>

<style>
.flex{
  display: flex;
  justify-content: space-between;
}
.el-table th.gutter {
  display: table-cell !important
}
</style>
